﻿Imports ModuloEstoque
Imports ModuloVendas
Imports ModuloFinanceiro
Public Class RelatorioUC
    Dim frm As New Object

    Private Sub TSBCategoria_Click(sender As System.Object, e As System.EventArgs) Handles TSBCategoria.Click
        frm = New CategoriaFRM
        frm.showdialog()
    End Sub

    Private Sub TSBClassFiscal_Click(sender As System.Object, e As System.EventArgs) Handles TSBClassFiscal.Click
        frm = New ClassificacaFiscalFRM
        frm.showdialog()
    End Sub

    Private Sub TSBFabricante_Click(sender As System.Object, e As System.EventArgs) Handles TSBFabricante.Click
        frm = New FabricanteFRM
        frm.showdialog()
    End Sub

    Private Sub TSBInventario_Click(sender As System.Object, e As System.EventArgs) Handles TSBInventario.Click
        frm = New IventariosFRM
        frm.showdialog()
    End Sub

    Private Sub TSBPeca_Click(sender As System.Object, e As System.EventArgs) Handles TSBPeca.Click
        frm = New PecaFRM
        frm.showdialog()
    End Sub

    Private Sub TSBServico_Click(sender As System.Object, e As System.EventArgs) Handles TSBServico.Click
        frm = New ServicoFRM
        frm.showdialog()
    End Sub

    Private Sub TSBFornecedor_Click(sender As System.Object, e As System.EventArgs) Handles TSBFornecedor.Click
        frm = New FornecedorFRM
        frm.showdialog()
    End Sub
    Private Sub TSBCurva_Click(sender As System.Object, e As System.EventArgs) Handles TSBCurva.Click
        gerarelatrio("Relatório da Curva ABC", "")
    End Sub

#Region "Relatorio"
    Public Sub gerarelatrio(titulo As String, formula As String)
        Try
            Dim frmrecursos As New RelatoriosFRM
            Dim rpt As New CurvaABC

            Try
                rpt.SetDatabaseLogon(usuariobanc, senhabanc)
                rpt.SetParameterValue(0, titulo)
                rpt.RecordSelectionFormula = formula
                frmrecursos.CrystalReportViewer1.ShowGroupTreeButton = False
                frmrecursos.CrystalReportViewer1.ReportSource = rpt
                frmrecursos.ShowDialog()
            Catch ex As Exception
                MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
            frmrecursos.Dispose()
            rpt = Nothing
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Finally

        End Try
    End Sub
#End Region

    Private Sub TSBCompra_Click(sender As System.Object, e As System.EventArgs) Handles TSBCompra.Click
        frm = New ComprasFRM
        frm.showdialog()
    End Sub

    Private Sub TSBMarca_Click(sender As System.Object, e As System.EventArgs) Handles TSBMarca.Click
        frm = New MarcasRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBPlaca_Click(sender As System.Object, e As System.EventArgs) Handles TSBPlaca.Click
        frm = New PlacasRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBCarro_Click(sender As System.Object, e As System.EventArgs) Handles TSBCarro.Click
        frm = New CarrosRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBCLiente_Click(sender As System.Object, e As System.EventArgs) Handles TSBCLiente.Click
        frm = New ClientesRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBCargo_Click(sender As System.Object, e As System.EventArgs) Handles TSBCargo.Click
        frm = New CargosRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBFuncionario_Click(sender As System.Object, e As System.EventArgs) Handles TSBFuncionario.Click
        frm = New FuncionariosRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBFluxoCaixa_Click(sender As System.Object, e As System.EventArgs) Handles TSBFluxoCaixa.Click
        frm = New FluxodeCaixaFRM
        frm.showdialog()
    End Sub

    Private Sub TSBBancos_Click(sender As System.Object, e As System.EventArgs) Handles TSBBancos.Click
        frm = New RelBancos
        frm.showdialog()
    End Sub

    Private Sub TSBCaixa_Click(sender As System.Object, e As System.EventArgs) Handles TSBCaixa.Click
        frm = New RelCaixa
        frm.showdialog()
    End Sub

    Private Sub TSBContas_Click(sender As System.Object, e As System.EventArgs) Handles TSBContas.Click
        frm = New RelContas
        frm.showdialog()
    End Sub

    Private Sub TSBContasPagar_Click(sender As System.Object, e As System.EventArgs) Handles TSBContasPagar.Click
        frm = New RelContasPagar
        frm.showdialog()
    End Sub

    Private Sub TSMenu_ItemClicked(sender As System.Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles TSMenu.ItemClicked
        
    End Sub

    Private Sub TSBFormaPgto_Click(sender As System.Object, e As System.EventArgs) Handles TSBFormaPgto.Click
        frm = New FormasPagamentoFRM
        frm.showdialog()
    End Sub

    Private Sub TSBPlanoContas_Click(sender As System.Object, e As System.EventArgs) Handles TSBPlanoContas.Click
        frm = New PlanodeContasFRM
        frm.showdialog()
    End Sub

    Private Sub TSBCentroCusto_Click(sender As System.Object, e As System.EventArgs) Handles TSBCentroCusto.Click
        Dim frm2 As New PlanodeContasFRM
        frm2.op = "C"
        frm2.ShowDialog()
    End Sub

    Private Sub TSBContasReceber_Click(sender As System.Object, e As System.EventArgs) Handles TSBContasReceber.Click
        frm = New ContasReceberFRM
        frm.showdialog()
    End Sub

    Private Sub TSBVendaOrca_Click(sender As System.Object, e As System.EventArgs) Handles TSBVendaOrca.Click
        frm = New OSRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBVenda_Click(sender As System.Object, e As System.EventArgs) Handles TSBVenda.Click
        frm = New VendaRelFRM
        frm.showdialog()
    End Sub

    Private Sub TSBAgendamento_Click(sender As System.Object, e As System.EventArgs) Handles TSBAgendamento.Click
        frm = New AgendamentoRelFRM
        frm.showdialog()
    End Sub
    Private Sub TSBPrestadores_Click(sender As System.Object, e As System.EventArgs) Handles TSBPrestadores.Click
        frm = New RelPrestador
        frm.showdialog()
    End Sub
End Class
